package
{
	import flash.display.Sprite;
	import flash.display.StageDisplayState;
	import flash.events.Event;
	import flash.utils.setTimeout;
	
	import view.Grid;
	public class GridView extends Sprite
	{
		public function GridView()
		{
			stage.frameRate=3;
			
			stage.align="tl";
			stage.scaleMode="noScale";
			stage.displayState="fullScreen";
			setTimeout(init,3000);
			stage.nativeWindow.alwaysInFront=true;
		}
		
		private function init():void{
			var cols:uint=Math.round(stage.stageWidth/100)+1;
			var rows:uint=Math.round(stage.stageHeight/100)+1;
			var grid:Grid;
			var col:uint;
			var row:uint;
			for(var i:uint=0;i<cols;i++)
			{
				for(var j:uint=0;j<rows;j++)
				{
					grid=new Grid();
					this.addChild(grid);
					
					col=i%cols;
					row=j%rows;
					grid.init(col,row);
					grid.x=col*grid.g_width;
					grid.y=row*grid.g_height;
				}
				
			}
		}
		
	}
}